#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
typedef int ElemType;
typedef int KeyType;
typedef char InfoType;
typedef struct {
	KeyType key;
	InfoType otherinfo;
}ElemType;
typedef struct
{
	ElemType* R;
	int length;
}SSTable;
int Search_Seq(SSTable ST, KeyType key) {
	int i;
	ST.R[0].key = key;
	for (i = ST.length; ST.R[i].key != key; i--);
	return i;
}
int Serrch_Bin(SSTable ST, KeyType key)
{
	int low, high;
	int mid;
	low = 1; high = ST.length;
	while (low <= high) {
		mid = (low + high) / 2;
		if (key == ST.R[mid].key) return mid;
		else if (key < ST.R[mid].key)high = mid - 1;
		else low = mid + 1;
	}
	return 0;
}
